<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JCSDK C# API Reference for Windows: JCSDK.JCStorage.JCStorage类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JCSDK C# API Reference for Windows
   &#160;<span id="projectnumber">2.3.3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_j_c_s_d_k.html">JCSDK</a></li><li class="navelem"><a class="el" href="namespace_j_c_s_d_k_1_1_j_c_storage.html">JCStorage</a></li><li class="navelem"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">JCSDK.JCStorage.JCStorage类 参考<div class="ingroups"><a class="el" href="group___xE6_x96_x87_xE4_xBB_xB6_xE5_xAD_x98_xE5_x82_xA8_xE6_xA8_xA1_xE5_x9D_x97.html">文件存储模块</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 JCSDK.JCStorage.JCStorage 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.png" usemap="#JCSDK.JCStorage.JCStorage_map" alt=""/>
  <map id="JCSDK.JCStorage.JCStorage_map" name="JCSDK.JCStorage.JCStorage_map">
<area href="interface_j_c_s_d_k_1_1_j_c_client_1_1_j_c_client_callback.html" alt="JCSDK.JCClient.JCClientCallback" shape="rect" coords="0,0,206,24"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a4d64ec1c9f9aec64c18ef4deba23d47d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#a4d64ec1c9f9aec64c18ef4deba23d47d">uploadFile</a> (string path)</td></tr>
<tr class="separator:a4d64ec1c9f9aec64c18ef4deba23d47d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2adc8024de1652eff25bcdb0c4afa0bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#a2adc8024de1652eff25bcdb0c4afa0bb">downloadFile</a> (string uri, string savaPath)</td></tr>
<tr class="separator:a2adc8024de1652eff25bcdb0c4afa0bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5714d6a2908ef5f5a948713ee5bcc926"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#a5714d6a2908ef5f5a948713ee5bcc926">cancleFile</a> (<a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> item)</td></tr>
<tr class="separator:a5714d6a2908ef5f5a948713ee5bcc926"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:ad90e77837802a2b335d08e6b4b7b2e1b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#ad90e77837802a2b335d08e6b4b7b2e1b">create</a> (<a class="el" href="class_j_c_s_d_k_1_1_j_c_client_1_1_j_c_client.html">JCClient.JCClient</a> client, <a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html">JCStorageCallback</a> callback)</td></tr>
<tr class="separator:ad90e77837802a2b335d08e6b4b7b2e1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e683685a653a6bbcbba830eac1d2c43"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#a3e683685a653a6bbcbba830eac1d2c43">destroy</a> ()</td></tr>
<tr class="separator:a3e683685a653a6bbcbba830eac1d2c43"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>文件存储类</p>
<p>上传文件：将文件上传至服务器，上传成功后服务器会返回文件地址，地址一般会有一定的有效期</p>
<p>下载文件：通过上传文件服务器返回的地址来下载该文件 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a5714d6a2908ef5f5a948713ee5bcc926"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5714d6a2908ef5f5a948713ee5bcc926">&#9670;&nbsp;</a></span>cancleFile()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool JCSDK.JCStorage.JCStorage.cancleFile </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a>&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>取消正在进行的文件上传下载</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">item</td><td><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> 对象，由 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#a4d64ec1c9f9aec64c18ef4deba23d47d">uploadFile</a> ，<a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#a2adc8024de1652eff25bcdb0c4afa0bb">downloadFile</a> 返回 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><ul>
<li>true: 成功，会收到 <a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html#aa22870b6e1d297adabe9e3a0ba8e6b06">onFileResult</a> 回调</li>
<li>false: 失败，不会收到回调 </li>
</ul>
</dd></dl>

</div>
</div>
<a id="ad90e77837802a2b335d08e6b4b7b2e1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad90e77837802a2b335d08e6b4b7b2e1b">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a> JCSDK.JCStorage.JCStorage.create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_j_c_s_d_k_1_1_j_c_client_1_1_j_c_client.html">JCClient.JCClient</a>&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html">JCStorageCallback</a>&#160;</td>
          <td class="paramname"><em>callback</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a> 对象</p>
<p><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a> 的所有接口函数，如无特殊说明，都建议在主线程调用</p>
<dl class="section note"><dt>注解</dt><dd><ul>
<li>调用此方法创建 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a> 对象后，期间没有调用过 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#a3e683685a653a6bbcbba830eac1d2c43">destroy</a> 方法销毁对象，然后又重复调用此方法，会直接返回第一次创建的 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a> 对象</li>
<li>调用此方法前确保 <a class="el" href="namespace_j_c_s_d_k_1_1_j_c_client.html">JCClient</a> 已完成初始化，即 <a class="el" href="class_j_c_s_d_k_1_1_j_c_client_1_1_j_c_client.html#a8b114554ece8a6e4e03dd8f91812b802">state</a> 状态值不等于 <a class="el" href="group___xE7_x99_xBB_xE5_xBD_x95_xE6_xA8_xA1_xE5_x9D_x97.html#ga2aa0686490aced8d8c24d3318a989af8">NotInit</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td><a class="el" href="namespace_j_c_s_d_k_1_1_j_c_client.html">JCClient</a> 对象 </td></tr>
    <tr><td class="paramname">callback</td><td><a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html">JCStorageCallback</a> 对象，用于回调相关通知 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a> 对象 </dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">client、callback 任意一个参数传空就会出现调用异常</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3e683685a653a6bbcbba830eac1d2c43"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e683685a653a6bbcbba830eac1d2c43">&#9670;&nbsp;</a></span>destroy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void JCSDK.JCStorage.JCStorage.destroy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>销毁对象</p>
<dl class="section note"><dt>注解</dt><dd>此方法为异步调用，所以在调用此方法后不能马上调用 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html#ad90e77837802a2b335d08e6b4b7b2e1b">create</a> 方法去重新创建 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage.html">JCStorage</a> 对象 </dd></dl>

</div>
</div>
<a id="a2adc8024de1652eff25bcdb0c4afa0bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2adc8024de1652eff25bcdb0c4afa0bb">&#9670;&nbsp;</a></span>downloadFile()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> JCSDK.JCStorage.JCStorage.downloadFile </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>savaPath</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>下载文件</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">uri</td><td>文件地址 </td></tr>
    <tr><td class="paramname">savePath</td><td><b>本地文件保存地址，由用户自行指定，需精确到文件名及格式，例如：/Documents/Juphoon/JCSample/audio.wmv。请确保目录存在且可写。</b> </td></tr>
    <tr><td class="paramname">cookie</td><td>标志数据<ul>
<li><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> 对象：<ul>
<li>调用底层接口成功，返回的 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 <a class="el" href="group___xE6_x96_x87_xE4_xBB_xB6_xE5_xAD_x98_xE5_x82_xA8_xE6_xA8_xA1_xE5_x9D_x97.html#gaac1c0da7b5cfc9c550b28e06adb2ea7e">Transfering</a>，并且会收到 <a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html#a44d54e9469563f97c8d34b323f84cd1f">onFileUpdate</a> 回调</li>
<li>调用底层接口失败，返回的 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 <a class="el" href="group___xE6_x96_x87_xE4_xBB_xB6_xE5_xAD_x98_xE5_x82_xA8_xE6_xA8_xA1_xE5_x9D_x97.html#gaac1c0da7b5cfc9c550b28e06adb2ea7e">Fail</a>，并且会收到 <a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html#aa22870b6e1d297adabe9e3a0ba8e6b06">onFileResult</a> 回调</li>
</ul>
</li>
<li>null：异常调用，不会收到回调 </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a4d64ec1c9f9aec64c18ef4deba23d47d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4d64ec1c9f9aec64c18ef4deba23d47d">&#9670;&nbsp;</a></span>uploadFile()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> JCSDK.JCStorage.JCStorage.uploadFile </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>path</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>上传文件</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td><b>文件路径，需精确到文件名及格式，例如：/Documents/Juphoon/JCSample/audio.wmv。请确保目录存在。</b> </td></tr>
    <tr><td class="paramname">cookie</td><td>标志数据 </td></tr>
    <tr><td class="paramname">expiredSeconds</td><td>过期秒数，-1表示永久 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd><ul>
<li><a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> 对象：<ul>
<li>调用底层接口成功，返回的 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 <a class="el" href="group___xE6_x96_x87_xE4_xBB_xB6_xE5_xAD_x98_xE5_x82_xA8_xE6_xA8_xA1_xE5_x9D_x97.html#gaac1c0da7b5cfc9c550b28e06adb2ea7e">Transfering</a>，并且会收到 <a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html#a44d54e9469563f97c8d34b323f84cd1f">onFileUpdate</a> 回调</li>
<li>调用底层接口失败，返回的 <a class="el" href="class_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 <a class="el" href="group___xE6_x96_x87_xE4_xBB_xB6_xE5_xAD_x98_xE5_x82_xA8_xE6_xA8_xA1_xE5_x9D_x97.html#gaac1c0da7b5cfc9c550b28e06adb2ea7e">Fail</a>，并且会收到 <a class="el" href="interface_j_c_s_d_k_1_1_j_c_storage_1_1_j_c_storage_callback.html#aa22870b6e1d297adabe9e3a0ba8e6b06">onFileResult</a> 回调</li>
</ul>
</li>
<li>null：异常调用，不会收到回调 </li>
</ul>
</dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>JCSDK/JCSDK/JCStorage/JCStorage.cs</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
